package com.milhouz.bomberrokon.sprite;

import com.stickycoding.Rokon.Rokon;
import com.stickycoding.Rokon.Texture;

/**
 * Item sprite
 */
public class ItemSprite extends SolidObject {

	private static final int ITEM_LIVE_TIME = 10000;
	private int mItemId;
	private int mItemType;
	/** Item live timer (ms) */
	private long mItemTimer = 0;

	public ItemSprite(int itemId, int itemType, float x, float y, Texture itemTextures) {
		super(x, y, itemTextures);
		mItemId = itemId;
		mItemType = itemType;
		mItemTimer = Rokon.getTime();
	}

	public boolean mustDisapeare() {
		if ((Rokon.getTime() - mItemTimer) >= ITEM_LIVE_TIME) {
			destroySprite();
			return true;
		}
		return false;
	}

	public void destroySprite() {
		this.setVisible(false);
		markForRemoval();
	}

	public int getItemId() {
		return mItemId;
	}

	public int getItemType() {
		return mItemType;
	}

}
